package com.itheima.stock.stocktimertesk.job;

import com.itheima.stock.stocktimertesk.StockTimerTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author: siwukun
 * @date: 2022/06/07
 * @description:
 */
@Component
public class StockJob {
    private static Logger logger = LoggerFactory.getLogger(StockJob.class);

    @Autowired
    private StockTimerTaskService service;

    /**
     * 国内大盘
     */
    @XxlJob("pullInnerStockData")
    public void demoJobHandler1() throws Exception {
        //todo 打印时间
        System.out.println("国内大盘股票数据拉取.....");
        service.pullInnerStockData();
    }

    /**
     * 股票实时数据拉取实现
     */
    @XxlJob("pullStockRtIndex")
    public void pullStockRtIndexJob() {
        System.out.println("股票实时数据拉取实现.....");
        service.pullInnerStockData();
    }

    /**
     * 国内板块数据拉取
     */
    @XxlJob("getStockSectorRtIndex")
    public void getStockSectorRtIndexJob() {
        System.out.println("国内板块数据拉取.....");
        service.getStockSectorRtIndex();
    }

    /**
     * 外盘
     */
    @XxlJob("getStockOutMarketData")
    public void getStockOutMarketData() {
        System.out.println("外盘数据拉取.....");
        service.StockOutMarketData();
    }
}